<?php
/**
 * Created by PhpStorm.
 * User: lijie
 * Date: 2018/10/3
 * Time: 13:46
 */
namespace app\api\validate;

use think\Validate;

class Year extends Validate{

    protected $rule = [
        'type' => ['number'],
        'u_id' => ['require'],
        'listNum' => ['number'],
        'y_id' => ['require','number'],
        'pagenum' => ['number'],
        'id' => ['require'],
        'candate' => ['require'],
        'desc' => ['require'],
        'title' => ['require'],
        'nowprice' => ['require']
    ];

    protected $message = [
        'type' => '卡片类型不合法',
        'u_id' => '必须要指定用户',
        'y_id' => '年卡指定有误',
        'listNum' => '每页数量格式错误',
        'pagenum' => '页数格式错误',
        'id' => '未指定修改对象',
        'candate' => '未指定有效期限',
        'desc' => '请对年卡进行描述',
        'title' => '请输入年卡标题',
        'nowprice' => '请输入年卡售价'
    ];

    protected $scene = [
        'yearCard' => ['type'],
        'myYearCard' => ['u_id','listNum','pagenum'],
        'myYearCardLog' => ['y_id','listNum','pagenum'],
        'editYear' => ['id','candate','desc','title','nowprice'],
        'delYear' => ['id'],
        'addYear' => ['candate','desc','title','nowprice'],
        'wxPay' => ['u_id','y_id','type']
    ];
}